package com.zw.yzk.kabu.mapper;

import com.zw.yzk.kabu.data.network.entity.FameListEntity;
import com.zw.yzk.kabu.model.FameModel;

import java.util.ArrayList;
import java.util.List;

import javax.inject.Inject;

/**
 * Created by zhanwei on 2017/1/12.
 */

public class FameListMapper {

    @Inject
    public FameListMapper() {

    }

    public List<FameModel> transfer(FameListEntity entity) {
        List<FameModel> modelList = new ArrayList<>();
        if (entity.result.fameList == null || entity.result.fameList.isEmpty()) {
            return modelList;
        }
        for (FameListEntity.Item item : entity.result.fameList) {
            FameModel model = new FameModel();
            model.setId(item.id);
            model.setNickName(item.nickName);
            model.setHeadUrl(item.headUrl);
            model.setFansCount(item.fansCount);
            model.setIntroduceText(item.introduceText);
            model.setIntroduceUrl(item.introduceUrl);
            model.setProvince(item.province);
            model.setCity(item.city);
            model.setRanking(item.ranking);

            modelList.add(model);
        }
        return modelList;
    }
}
